﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.trans
{
    public partial class Select_trans : Form
    {
        public Select_trans()
        {
            InitializeComponent();
        }

        private void Select_trans_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“dataSet_view.vw_trans”中。您可以根据需要移动或移除它。
            this.vw_transTableAdapter.Fill(this.dataSet_view.vw_trans);

        }

        public int ID
        {
            get{
                
                    return (int)gv_trans.SelectedRows[0].Cells["c_id"].Value;
                
            }
        }
        public bool HasSelected
        {
            get{
                if (gv_trans.SelectedRows.Count > 0)
                    return true;
                else
                    return false;
            }
        }
        private void bt_save_Click(object sender, EventArgs e)
        {
            if (gv_trans.SelectedRows.Count ==0)
                this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void gv_trans_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            for (int i = 0; i < gv_trans.Rows.Count; i++)
            {
                gv_trans.Rows[i].DefaultCellStyle.BackColor = Color.AntiqueWhite;
                i++;
            }
        }

    }
}
